#ifndef _EXAMPLE_TALKER_NODE_
#define _EXAMPLE_TALKER_NODE_

#include <iostream>

#include <rclcpp/rclcpp.hpp>
#include <rclcpp_components/register_node_macro.hpp>

#include <sensor_msgs/msg/point_cloud2.hpp>
#include <sensor_msgs/msg/image.hpp>
#include <geometry_msgs/msg/pose.hpp>

#include <tf2/LinearMath/Quaternion.h>
#include <tf2_ros/transform_listener.h>
#include <tf2_ros/transform_broadcaster.h>
#include <tf2_eigen/tf2_eigen.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2_ros/static_transform_broadcaster.h>

#include <tf2_ros/buffer.h>
#include <tf2_ros/transform_listener.h>
#include "rclcpp/time.hpp"
#include <rclcpp/time_source.hpp>

#include <cv_bridge/cv_bridge.h>

#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include "opencv2/imgproc.hpp"
#include "opencv2/calib3d.hpp"
#include <opencv2/highgui.hpp>

#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/search/impl/search.hpp>
#include <pcl/range_image/range_image.h>
#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/common/common.h>
#include <pcl/common/transforms.h>
#include <pcl/registration/icp.h>
#include <pcl/io/pcd_io.h>
#include <pcl/filters/filter.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/filters/crop_box.h>
#include <pcl_conversions/pcl_conversions.h>

namespace mars_rover
{
  namespace talker
  {
    class TalkerNode : public rclcpp::Node
    {
    private:
      /* data */
      std::vector<double> transform_; //参数
      std::vector<double> pose_data_; //参数
      std::shared_ptr<std::thread> pub_thread_; //这个要重点注意
      std::string target_frame_; //参数
      std::string source_frame_; //参数
      std::string image_dir_; //参数
      std::string pcd_dir_; //参数
      geometry_msgs::msg::TransformStamped transform_stamp_;
      
      sensor_msgs::msg::PointCloud2 pointcloud_;
      sensor_msgs::msg::Image image_;
      geometry_msgs::msg::PoseStamped pose_;

      rclcpp::Publisher<sensor_msgs::msg::PointCloud2>::SharedPtr pointcloud_publisher_;
      rclcpp::Publisher<sensor_msgs::msg::Image>::SharedPtr image_publisher_;
      rclcpp::Publisher<geometry_msgs::msg::PoseStamped>::SharedPtr pose_publisher_;
      std::shared_ptr<tf2_ros::StaticTransformBroadcaster> static_tf_broadcaster_;
      /*function*/
      bool init();
      void run();
    public:
      explicit TalkerNode(const rclcpp::NodeOptions &options);
    };
    
  } // namespace talker
} // namespace mars_rover


#endif